﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.IO;
using System.Globalization;

public partial class ResumeSearchBySkills : System.Web.UI.Page
{
    string mode = "BySkills";
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            FillSkills();
        }
    }
    protected void rptSkills_ItemCommand(object source, DataListCommandEventArgs e)
    {
        if (Convert.ToString(e.CommandName) == "SkillsSearch")
        {
            string skill = Convert.ToString(e.CommandArgument);
            if (skill != "")
            {
                mode = clsEncryptionDecryption.EncryptQueryString(mode);
                Response.Redirect("ResumeSearchResult.aspx?mode=" + mode + "&skillset=" + clsEncryptionDecryption.EncryptQueryString(skill.Trim().ToLower()));
            }
        }
    }
    protected void FillSkills()
    {
        try
        {
            clsSkillsMasterDAL objclsSkillsMasterDAL = new clsSkillsMasterDAL();
            List<IN_TB_SKILL_MST> objIN_TB_SKILL_MST = new List<IN_TB_SKILL_MST>();
            objIN_TB_SKILL_MST = objclsSkillsMasterDAL.GetAllSkills();
            rptSkills.DataSource = objIN_TB_SKILL_MST;
            rptSkills.DataBind();
        }
        catch (Exception)
        {

            throw;
        }
    }

    protected void btnSeachBySkills_Click(object sender, EventArgs e)
    {
        try
        {
            if (txtKeySkills.Text != "")
            {
                mode = clsEncryptionDecryption.EncryptQueryString(mode);
                Response.Redirect("ResumeSearchResult.aspx?mode=" + mode + "&skillset=" + clsEncryptionDecryption.EncryptQueryString(txtKeySkills.Text.Trim().ToLower()));
            }
        }
        catch (Exception)
        {
            throw;
        }
    }
    protected void btnClearSearch_Click(object sender, EventArgs e)
    {
        try
        {
            txtKeySkills.Text = "";
        }
        catch (Exception)
        {

            throw;
        }
    }

    //protected void grdSeachBySkills_RowCommand(object sender, GridViewCommandEventArgs e)
    //{
    //    if (e.CommandName == "ViewCV")
    //    {
    //        if (Session["UserId"] != null)
    //        {
    //            string UserId = Convert.ToString(e.CommandArgument);
    //            clsSearchResume objclsSearchResume = new clsSearchResume();
    //            clsResumeSearchResultBo objclsResumeSearchResultBo = new clsResumeSearchResultBo();
    //            objclsResumeSearchResultBo = objclsSearchResume.GetResumeByUserId(Convert.ToInt32(UserId));

    //            if (objclsResumeSearchResultBo != null)
    //            {
    //                redirectlink = "ResumeDetails.aspx?userid=" + Convert.ToString(e.CommandArgument);
    //                string skillset = Convert.ToString(objclsResumeSearchResultBo.SKILL_SET);
    //                if (skillset != "" && skillset != null)
    //                {
    //                    skillset = clsEncryptionDecryption.EncryptQueryString(skillset);
    //                    redirectlink += "&skillset=" + skillset;
    //                }
    //                string email = Convert.ToString(objclsResumeSearchResultBo.EMAIL);
    //                if (email != "" && email != null)
    //                {
    //                    email = clsEncryptionDecryption.EncryptQueryString(email);
    //                    redirectlink += "&email=" + email;
    //                }
    //                string mobile = Convert.ToString(objclsResumeSearchResultBo.MOBILE);
    //                if (mobile != "" && mobile != null)
    //                {
    //                    mobile = clsEncryptionDecryption.EncryptQueryString(mobile);
    //                    redirectlink += "&mobile=" + mobile;
    //                }
    //                string phone = Convert.ToString(objclsResumeSearchResultBo.PHONE);
    //                if (phone != "" && phone != null)
    //                {
    //                    phone = clsEncryptionDecryption.EncryptQueryString(phone);
    //                    redirectlink += "&phone=" + phone;
    //                }
    //                string experience = Convert.ToString(objclsResumeSearchResultBo.EXPERIENCE);
    //                if (experience != "" && experience != null)
    //                {
    //                    experience = clsEncryptionDecryption.EncryptQueryString(experience);
    //                    redirectlink += "&experience=" + experience;
    //                }
    //                string currentcomp = Convert.ToString(objclsResumeSearchResultBo.CURRENT_COMPANY);
    //                if (currentcomp != "" && currentcomp != null)
    //                {
    //                    currentcomp = clsEncryptionDecryption.EncryptQueryString(currentcomp);
    //                    redirectlink += "&currentcomp=" + currentcomp;
    //                }
    //                string currentdesig = Convert.ToString(objclsResumeSearchResultBo.CURRENT_POST);
    //                if (currentdesig != "" && currentdesig != null)
    //                {
    //                    currentdesig = clsEncryptionDecryption.EncryptQueryString(currentdesig);
    //                    redirectlink += "&currentdesig=" + currentdesig;
    //                }
    //                string currentloc = Convert.ToString(objclsResumeSearchResultBo.CURRENT_LOCATION);
    //                if (currentloc != "" && currentloc != null)
    //                {
    //                    currentloc = clsEncryptionDecryption.EncryptQueryString(currentloc);
    //                    redirectlink += "&currentloc=" + currentloc;
    //                }
    //                string currentctc = Convert.ToString(objclsResumeSearchResultBo.CURRENT_CTC);
    //                if (currentctc != "" && currentctc != null)
    //                {
    //                    currentctc = clsEncryptionDecryption.EncryptQueryString(currentctc);
    //                    redirectlink += "&currentloc=" + currentloc;
    //                }
    //                string functionalarea = Convert.ToString(objclsResumeSearchResultBo.FUNCTIONAL_AREA);
    //                if (functionalarea != "" && functionalarea != null)
    //                {
    //                    functionalarea = clsEncryptionDecryption.EncryptQueryString(functionalarea);
    //                    redirectlink += "&functionalarea=" + functionalarea;
    //                }
    //                string preferredlocation = Convert.ToString(objclsResumeSearchResultBo.PREFERRED_LOCATION);
    //                if (preferredlocation != "" && preferredlocation != null)
    //                {
    //                    preferredlocation = clsEncryptionDecryption.EncryptQueryString(preferredlocation);
    //                    redirectlink += "&preferredlocation=" + preferredlocation;
    //                }
    //                string cvpath = Convert.ToString(objclsResumeSearchResultBo.CV_PATH);
    //                if (cvpath != "" && cvpath != null)
    //                {
    //                    cvpath = clsEncryptionDecryption.EncryptQueryString(cvpath);
    //                    redirectlink += "&cvpath=" + cvpath;
    //                }
    //                string downloadtill = Convert.ToString(objclsResumeSearchResultBo.DOWNLOAD_TILL);
    //                if (downloadtill != "" && downloadtill != null)
    //                {
    //                    downloadtill = clsEncryptionDecryption.EncryptQueryString(downloadtill);
    //                    redirectlink += "&downloadtill=" + downloadtill;
    //                }
    //                Response.Redirect(redirectlink);
    //            }
    //        }
    //        else
    //        {
    //            Response.Redirect("EmployerLogin.aspx");
    //        }
    //    }
    //}
}